package com.lsp.test;


import com.lsp.annotation.Service;
import com.lsp.annotation.Transactional;
import com.lsp.helper.DatabaseHelper;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Service
public class UserService implements IUser {

    @Override
    public List<User> getAllUser(){
        List<User> userList = new ArrayList<>();
        userList.add(new User("","lsp","123456"));
        userList.add(new User("","xjp","654321"));
        return userList;
    }

    /**
     * 修改用户信息
     * @param id
     * @param fieldMap
     * @return
     */
    @Transactional
    @Override
    public boolean updateUser(String id, Map<String, Object> fieldMap){
        return DatabaseHelper.updateEntity(User.class, id, fieldMap);
    }
}
